/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.inventory.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author sithum
 */
@Entity
@Table(name = "INVOICE_STATUS", catalog = "", schema = "APP")
@NamedQueries({@NamedQuery(name = "InvoiceStatus.findAll", query = "SELECT i FROM InvoiceStatus i"), @NamedQuery(name = "InvoiceStatus.findByInvoiceStatusId", query = "SELECT i FROM InvoiceStatus i WHERE i.invoiceStatusId = :invoiceStatusId"), @NamedQuery(name = "InvoiceStatus.findByStatus", query = "SELECT i FROM InvoiceStatus i WHERE i.status = :status")})
public class InvoiceStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "INVOICE_STATUS_ID", nullable = false)
    private Integer invoiceStatusId;
    @Column(name = "STATUS", length = 50)
    private String status;
    @OneToMany(mappedBy = "invoiceStatusId")
    private List<Invoice> invoiceCollection;

    public InvoiceStatus() {
    }

    public InvoiceStatus(Integer invoiceStatusId) {
        this.invoiceStatusId = invoiceStatusId;
    }

    public Integer getInvoiceStatusId() {
        return invoiceStatusId;
    }

    public void setInvoiceStatusId(Integer invoiceStatusId) {
        this.invoiceStatusId = invoiceStatusId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<Invoice> getInvoiceCollection() {
        return invoiceCollection;
    }

    public void setInvoiceCollection(List<Invoice> invoiceCollection) {
        this.invoiceCollection = invoiceCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (invoiceStatusId != null ? invoiceStatusId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InvoiceStatus)) {
            return false;
        }
        InvoiceStatus other = (InvoiceStatus) object;
        if ((this.invoiceStatusId == null && other.invoiceStatusId != null) || (this.invoiceStatusId != null && !this.invoiceStatusId.equals(other.invoiceStatusId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.inventory.entities.InvoiceStatus[invoiceStatusId=" + invoiceStatusId + "]";
    }

}
